﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PALMS.Utils.Encryption;
using PALMS.Utils.Text;

namespace PALMS.Model.Transformers
{
    internal static class Encryption
    {
        private const string KEY = "obavpxd9k9ime95m304iobavpxd9k9im";
        private static readonly SimpleSymmetricCrypt Cypher;

        static Encryption()
        {
            Cypher = new SimpleSymmetricCrypt();
        }
        
        public static string Encrypt(this string s)
        {
            if (s.IsNullOrBlank()) return s;
            return Cypher.Encrypt(s, KEY);
        }

        public static string Decrypt(this string s)
        {
            if (s.IsNullOrBlank()) return s;
            return Cypher.Decrypt(s, KEY);
        }
    }
}
